#define _ALARM_H_

#ifndef _ALARM_C_
#define _EXT_ extern
#else
#define _EXT_
#endif

#define C_STATE_ALARM_EMPTY 0x00
#define C_STATE_ALARM_STOPPED 0x01
#define C_STATE_ALARM_INACTIVE 0x02 // set to active at 0:00:00
#define C_STATE_ALARM_ACTIVE 0x03   // waiting for alarm time
#define C_STATE_ALARM_TRIGGERED 0x04 // not used

#define C_STATE_ALARM_REPEAT 0x10

#define C_ALARM_TYPE_START_HEATER 0x01
#define C_ALARM_TYPE_STOP_HEATER 0x02

#define C_MAX_ALARMS 5

typedef struct s_alarm {
    unsigned char ucID;
    unsigned char ucState;
    unsigned char ucActionType;
    t_time time;
//    t_date date; // currently not used
} t_alarm;


// define prototypes
_EXT_ void alarmBG(void);
_EXT_ unsigned int setAlarm(unsigned char ucID, t_time* time, unsigned char ucAlarmType, unsigned char ucRepeat);

#undef _EXT_
// end _ALARM_H_

